<template>
  <div class="htmlBox">
    <div>
      <el-tabs type="border-card" >
        <el-tab-pane v-for="date in lastWeekDates" :label="date" :key="date">
          <div class="two">
            <div class="one1" style="display: flex">
              <div class="right" style="width: 500px">
                aa

              </div>
              <div class="left" style="margin-left: 50px;width: 500px">
                bb

              </div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>

  </div>
</template>


<script>
export default {
  name: "AchievementView",
  data() {
    return {
      lastWeekDates: []
    }
  },
  created() {
    this.calculateLastWeekDates();
  },
  methods: {
    calculateLastWeekDates() {
      const today = new Date();
      const lastWeekDates = [];

      for (let i = 0; i < 7; i++) {
        const date = new Date(today);
        date.setDate(today.getDate() - i+1);
        lastWeekDates.push(date.toISOString().split('T')[0]); // 格式化日期并存储在数组中
      }

      this.lastWeekDates = lastWeekDates; // 倒序排列日期
    },
  }

}
</script>

<style scoped>
.htmlBox >>> div {
  /*background-color: #fae2e2;*/
}

.two {
  padding: 50px;

}

</style>